package server;

import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Date;

import model.Order;
import model.Stock;
import server.exception.InvalidOrderException;
import server.exception.LoginException;
import server.exception.RegistrationException;
import client.Client;

public interface Server extends java.rmi.Remote {

	public void registerUser(Client client, String username, String password)
			throws RemoteException, RegistrationException;

	public void loginUser(Client client, String username, String password)
			throws RemoteException, LoginException;

	public void buyStock(Client client, String stockname, int number, int price)
			throws RemoteException, InvalidOrderException;

	public void sellStock(Client client, String stockname, int number, int price)
			throws RemoteException, InvalidOrderException;

	public void cancelSell(Client client, String transactionID)
			throws RemoteException;

	public void cancelBuy(Client client, String transactionID)
			throws RemoteException;

	public ArrayList<Stock> getStocks(Client client) throws RemoteException;

	public ArrayList<Order> getSellOffers(Client client, String stockname)
			throws RemoteException;

	public ArrayList<Order> getBuyOffers(Client client, String stockName)
			throws RemoteException;
		
	public ArrayList<Order> getUserOrders(Client client) throws RemoteException;
	
	public ArrayList<Order> getUserHistory(Client client, Date a, Date b) throws RemoteException;
	
	public void logoutUser(Client client) throws RemoteException;
	
	public Integer getHolding(Client client, String stockname) throws RemoteException;
}
